<?php
namespace App\Model;

use App\Elasticsearch\LogIndexConfigurator;
use Illuminate\Database\Eloquent\Model;
use ScoutElastic\Searchable;

class Log extends Model
{
    use Searchable;
    protected $table = 'logs';
    protected $fillable = ['content', 'type', 'created_at', 'updated_at', 'deleted_at'];

    protected $indexConfigurator = LogIndexConfigurator::class;

    protected $mapping = [
        'properties' => [
            'id' => [
                'type' => 'integer',
            ],
            'content' => [
                'type' => 'text'
            ],
            'level' => [
                'type' => 'keyword'
            ],
        ]
    ];
}